#
# THU-Render
#
# Copyright 2007 CG & CAD Institute, Tsinghua University.
# All rights reserved.
#

IF(WIN32)
    IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
        SET(CPPUNIT_LIBRARY_NAME cppunitd
            CACHE STRING "The CppUnit libraries.")
    ELSE("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
        SET(CPPUNIT_LIBRARY_NAME cppunit
            CACHE STRING "The CppUnit libraries.")
    ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
ELSE(WIN32)
    SET(CPPUNIT_LIBRARY_NAME cppunit CACHE STRING "The CppUnit libraries.")
    PKG_CHECK_MODULES(CPPUNIT REQUIRED cppunit)
ENDIF(WIN32)

FIND_PATH(CPPUNIT_INCLUDE_DIR cppunit/TestSuite.h
    PATHS /usr/include /usr/local/include $ENV{CPPUNIT}/include
    DOC "The CppUnit header searching path."
)
FIND_LIBRARY(CPPUNIT_LIBRARY ${CPPUNIT_LIBRARY_NAME}
    PATHS /usr/lib /usr/local/lib $ENV{CPPUNIT}/lib
    DOC "The CppUnit library path."
)
